import {
  Affix,
  Alert,
  Anchor,
  AnchorLink,
  AutoComplete,
  AutoCompleteOptGroup,
  AutoCompleteOption,
  Avatar,
  AvatarGroup,
  BackTop,
  Badge,
  BadgeRibbon,
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbSeparator,
  Button,
  ButtonGroup,
  Calendar,
  Card,
  CardGrid,
  CardMeta,
  Carousel,
  Cascader,
  CheckableTag,
  Checkbox,
  CheckboxGroup,
  Col,
  Collapse,
  CollapsePanel,
  Comment,
  ConfigProvider,
  DatePicker,
  Descriptions,
  DescriptionsItem,
  DirectoryTree,
  Divider,
  Drawer,
  Dropdown,
  DropdownButton,
  Empty,
  Form,
  FormItem,
  FormItemRest,
  Grid,
  Image,
  ImagePreviewGroup,
  Input,
  InputGroup,
  InputNumber,
  InputPassword,
  InputSearch,
  Layout,
  LayoutContent,
  LayoutFooter,
  LayoutHeader,
  LayoutSider,
  List,
  ListItem,
  ListItemMeta,
  LocaleProvider,
  Mentions,
  MentionsOption,
  Menu,
  MenuDivider,
  MenuItem,
  MenuItemGroup,
  Modal,
  MonthPicker,
  PageHeader,
  Pagination,
  Popconfirm,
  Popover,
  Progress,
  QuarterPicker,
  Radio,
  RadioButton,
  RadioGroup,
  RangePicker,
  Rate,
  Result,
  Row,
  Select,
  SelectOptGroup,
  SelectOption,
  Skeleton,
  SkeletonAvatar,
  SkeletonButton,
  SkeletonImage,
  SkeletonInput,
  SkeletonTitle,
  Slider,
  Space,
  Spin,
  Statistic,
  StatisticCountdown,
  Step,
  Steps,
  SubMenu,
  Switch,
  TabPane,
  Table,
  TableColumn,
  TableColumnGroup,
  TableSummary,
  TableSummaryCell,
  TableSummaryRow,
  Tabs,
  Tag,
  Textarea,
  TimePicker,
  TimeRangePicker,
  Timeline,
  TimelineItem,
  Tooltip,
  Transfer,
  Tree,
  TreeNode,
  TreeSelect,
  TreeSelectNode,
  Typography,
  TypographyLink,
  TypographyParagraph,
  TypographyText,
  TypographyTitle,
  Upload,
  UploadDragger,
  WeekPicker,
  message,
  notification,
  version,
} from "ant-design-vue";
import SSearch from "./packages/search";
import STable from "./packages/table";
import SModal from "./packages/modal";
import SDrawer from "./packages/drawer";
import SDesign from "./packages";
import SButton from "./packages/button";
import STitle from "./packages/title";
// import Mask from "./packages/mask";
import SDiv from "./packages/div/index.vue";
import SDropdown from "./packages/dropdown";
const ExtraComponents = [
  SDropdown,
  SDiv,
  SSearch,
  STable,
  SModal,
  SDrawer,
  SDesign,
  SButton,
  STitle,
];
const components = [
  ...ExtraComponents,
  ConfigProvider,
  Layout,
  Input,
  Image,
  InputNumber,
  Button,
  Switch,
  Radio,
  Checkbox,
  Select,
  Card,
  Form,
  Row,
  Col,
  Modal,
  Table,
  Tabs,
  Badge,
  Popover,
  Dropdown,
  List,
  Avatar,
  Breadcrumb,
  Steps,
  Space,
  Spin,
  Menu,
  Drawer,
  Tooltip,
  Alert,
  Tag,
  Divider,
  DatePicker,
  TimePicker,
  Upload,
  Progress,
  Skeleton,
  Popconfirm,
  PageHeader,
  Result,
  Statistic,
  Descriptions,
  Collapse,
  Timeline,
  AutoComplete,
  Transfer,
  TreeSelect,
  Pagination,
  Tree,
  Cascader,
  Anchor,
  Carousel,
  BackTop,
  Empty,
];
const install = function install(app) {
  Object.keys(components).forEach(function (key) {
    const component = components[key];
    if (!component.install) {
      component.install = function (app: any) {
        app.component(this.name, this);
      };
    }
    app.use(component);
  });
  app.config.globalProperties.$message = message;
  app.config.globalProperties.$notification = notification;
  app.config.globalProperties.$info = Modal.info;
  app.config.globalProperties.$success = Modal.success;
  app.config.globalProperties.$error = Modal.error;
  app.config.globalProperties.$warning = Modal.warning;
  app.config.globalProperties.$confirm = Modal.confirm;
  app.config.globalProperties.$destroyAll = Modal.destroyAll;
  return app;
};
export default {
  install,
};
